package com.power.using.mydaggerp.model.book.tabs;

import android.support.annotation.NonNull;

import com.power.using.mydaggerp.api.DoubanApi;
import com.power.using.mydaggerp.base.BaseModel;
import com.power.using.mydaggerp.contract.book.tabs.BookCustomContract;
import com.power.using.mydaggerp.model.bean.douban.book.BookListBean;
import com.zyw.horrarndoo.sdk.helper.RetrofitCreateHelper;
import com.zyw.horrarndoo.sdk.helper.RxHelper;

import io.reactivex.Observable;

/**
 * Created by 聪明一只哈 on 2019/10/18.
 * Time: 2019/10/18  9:51
 */
public class BookCustomModel extends BaseModel implements BookCustomContract.IBookCustomModel{

    @NonNull
    public static BookCustomModel newInstance() {
        return new BookCustomModel();
    }


    @Override
    public Observable<BookListBean> getBookListWithTag(String tag, int start, int count) {
        return RetrofitCreateHelper.createApi(DoubanApi.class,DoubanApi.HOST).getBookListWithTag(tag, start, count)
                .compose(RxHelper.<BookListBean>rxSchedulerHelper());
    }
}
